
import { Button, Form, Input, Spin } from "antd";
import TextArea from "antd/es/input/TextArea";
import { FieldType, useConfigLink } from "../hooks/useConfigLink";

export default function ConfigLink() {
  const {btnLoading,form,loading,onFinish}= useConfigLink()
  return (
    <Spin spinning={loading}>
      <Form
        form={form}
        name="configHomeText"
        size="middle"
        onFinish={onFinish}
        autoComplete="off"
        layout="vertical"
      >
        <Form.Item<FieldType>
          name="name"
          label="网站名称"
          rules={[{ required: true, message: "请输入!" }]}
        >
          <Input  />
        </Form.Item>

        <Form.Item<FieldType>
          name="url"
          label="网址"
          rules={[{ required: true, message: "请输入!" }]}
        >
          <TextArea  />
        </Form.Item>
        <Form.Item<FieldType>
          name="logo"
          label="logo"
          rules={[{ required: true, message: "请输入!" }]}
        >
          <TextArea  />
        </Form.Item>
        <Form.Item<FieldType>
          name="icon"
          label="图标"
          rules={[{ required: true, message: "请输入!" }]}
        >
          <TextArea  />
        </Form.Item>
        <Form.Item<FieldType>
          name="desc"
          label="描述"
          rules={[{ required: true, message: "请输入!" }]}
        >
          <TextArea  />
        </Form.Item>
        <Form.Item>
          <Button type="primary" htmlType="submit" loading={btnLoading}>
            保存
          </Button>
        </Form.Item>
      </Form>
    </Spin>
  );
}
